package Structural.Proxy.demo2;

import java.lang.reflect.Proxy;

public class ProxyDemo2 {

	public static void main(String[] args) {
		Tank tank = new Tank();
		// System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true");
		// System.getProperties().put("jdk.proxy.ProxyGenerator.saveGeneratedFiles", "true");
		MoveAble moveAble = (MoveAble) Proxy.newProxyInstance(
				Tank.class.getClassLoader(),
				new Class[]{MoveAble.class},
				new LogHandler(tank)
		);
		moveAble.move();
	}
}
